<template>
  <div class="vfor-tpl">
      <span v-for="(value,key,index) in obj" :key="index">
          索引:{{index+1}} 键名：{{key}} 属性值：{{value}}
      </span>
  </div>
</template>

<script>
import { reactive, toRefs } from 'vue'
export default {
  name: 'VforTpl',
  setup () {
    const state = reactive({
      obj: {
        语文: 100,
        数学: 90,
        英语: 99
      }
    })
    return {
      ...toRefs(state)
    }
  }
}
</script>

<style scoped lang="scss">

</style>
